package org.linlinjava.litemall.core.exception;

/**
 * @Description: TODO
 * @author: Destin
 * @date: 2021-12-31
 */
public interface ErrorCode {
    int FAILED_TYPE_INTERNAL = 500;
    int FAILED_TYPE_BUSINESS = 20000;
    int FAILED_TYPE_BADREQUEST = 400;
    int FAILED_TYPE_UNAUTHORIZED = 401;
    int FAILED_TYPE_FORBIDDEN = 403;

    int getCode();

    public static enum SystemDefaultCode implements ErrorCode {
        INTERNAL_SERVER_ERROR(500),
        BAD_REQUEST(400),
        BUSINESS_EXCEPTION(20000),
        REQUEST_UNAUTHORIZED(401),
        REQUEST_FORBIDDEN(403);

        private int code;

        private SystemDefaultCode(int code) {
            this.code = code;
        }

        public int getCode() {
            return this.code;
        }
    }
}